测试链接：https://leetcode.cn/problems/container-with-most-water/description/
class Solution {
public:
    int maxArea(vector<int>& height) {
        int n = height.size();
        int l = 0, r = n -1;
        int ans = 0;
        for(int i = l ; l <=r; )
        {
            if(height[l] <= height[r])
            {
                ans = max(ans, min(height[l], height[r])*(r - l));
                l++;
            }
            else
            {
                ans = max(ans, min(height[l], height[r])* (r - l));
                r--;
            }
        }

        return ans;
    }
};